home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / opint102.5rc / OPINT.TXT < prev    next >
Text File  |  1988-12-04  |  63KB  |  1,049 lines

  1. Unit OpInt;
  2.  
  3.   {***************************************************************************}
  4.   {*                                                                         *}
  5.   {* O p u s   I n t e r f a c e    V e r  1.02                              *}
  6.   {*                                                                         *}
  7.   {* Opus V 1.0x Interface for Turbo Pascal Ver 4.0                          *}
  8.   {*                                                                         *}
  9.   {*  These Structures,Procedures and Functions may help you to make OPUS    *}
  10.   {* utilities for to help other SysOps, Please read the Dokumentation.      *}
  11.   {*                                                                         *}
  12.   {*  Regards                                                                *}
  13.   {*    Per Holm                                                             *}
  14.   {*                                                                         *}
  15.   {*   FIDO: Per Holm - Asgaard BBS 2:230/22.0                               *}
  16.   {*   UUCP: perholm@daimi.DK                                                *}
  17.   {*                                                                         *}
  18.   {***************************************************************************}
  19.  
  20. Interface
  21.  
  22. Uses Dos;
  23.  
  24. CONST  { Some Nice helpfull constants }
  25.   _Months = 'JanFebMarAprMayJunJulAugSepOctNovDec';
  26.  
  27. TYPE
  28.   _Lines = String[80];
  29.   _StrSys = String[39];
  30.   _Str = STRING[64];
  31.  
  32.   {***************************************************************************}
  33.   {* MESSAGE AND FILE AREAS                                                  *}
  34.   {***************************************************************************}
  35.  
  36.   {---------------------------------------------------------------------------}
  37.   {- Area attributes ( Limit or describe the behavior of an area             -}
  38.   {---------------------------------------------------------------------------}
  39.  
  40. CONST
  41.   SYSMAIL   = $01;     {* Is a mail area                                     *}
  42.   SYSOVR    = $02;     {* Overwrite files is OK                              *}
  43.   NOPUBLIC  = $04;     {* OPUS: Disallow public messages                     *}
  44.   NOPRIVATE = $08;     {* OPUS: Disallow private messages                    *}
  45.   ANON_OK   = $10;     {* OPUS: Enable anonymous messages                    *}
  46.   ECHOMAIL  = $20;     {* OPUS: Set = Echo-Mail, Clear = no echo mail        *}
  47.  
  48.   {---------------------------------------------------------------------------}
  49.   {- System??.BBS structure ( Don't consider the structure stable            -}
  50.   {---------------------------------------------------------------------------}
  51.  
  52. TYPE
  53.   _Sys = RECORD                    {******************************************}
  54.            ls_caller : Word;       {*                                        *}
  55.            priv      : Integer;    {* Privilege to use this area             *}
  56.            Msgpath   : _StrSys;    {* Path to message directory              *}
  57.            Bbspath   : _StrSys;    {* Path to .BBS files / Barricade files   *}
  58.            Hlppath   : _StrSys;    {* Path to help directory                 *}
  59.            Uplpath   : _StrSys;    {* Path to Upload Directory.              *}
  60.            filepath  : _StrSys;    {* Path to download directory             *}
  61.            attrib    : Integer;    {* Message/File Atributes (look up.)      *}
  62.            ms_caller : Integer;    {*                                        *}
  63.            Quote     : LongInt;    {*                                        *}
  64.          End;                      {******************************************}
  65.  
  66.   _MSGAREA = RECORD                {******************************************}
  67.                AREA: Integer;      {* Area Number (0-99)                     *}
  68.                MSG: Integer;       {* Message Number                         *}
  69.              END;                  {******************************************}
  70.  
  71.   {***************************************************************************}
  72.   {* OPUS USER FILE Structure                                                *}
  73.   {***************************************************************************}
  74.  
  75.   {---------------------------------------------------------------------------}
  76.   {- User Privileges                                                         -}
  77.   {---------------------------------------------------------------------------}
  78.  
  79. CONST
  80.   Twit       = -2;
  81.   Disgrace   =  0;
  82.   Normal     =  2;
  83.   Privil     =  4;
  84.   Privileged =  4;
  85.   Extra      =  6;
  86.   AsstSysOp  =  8;
  87.   SysOp      = 10;
  88.   Hidden     = 11;
  89.  
  90.   {---------------------------------------------------------------------------}
  91.   {- User Setup Flags.                                                       -}
  92.   {---------------------------------------------------------------------------}
  93.  
  94.   Usr_UseLore  = $08;     { Use the Line Oriented Editor                      }
  95.   Usr_More     = $10;     { Want's the More Prompt                            }
  96.   Usr_Ansi     = $20;     { OPUS: User wants ANSI                             }
  97.   Usr_Kludge   = $40;     { OPUS: Opus Used before                            }
  98.   Usr_FormFeed = $80;     { OPUS: Transmit <FF>                               }
  99.  
  100.   MaxUserRec = 4000;      { The maximum number of Records available in memory }
  101.  
  102.   {---------------------------------------------------------------------------}
  103.   {- Userfile Structure                                                      -}
  104.   {---------------------------------------------------------------------------}
  105.  
  106. TYPE
  107.   _Usr = RECORD                             {*********************************}
  108.           Name,                             {* First and Last-name.          *}
  109.           City:String[35];                  {* City,Country.                 *}
  110.           Lastread:Array[1..10] of _MsgArea;{* Lastread msg# for 10 areas.   *}
  111.           Password:String[15];              {* Password.                     *}
  112.           Calls,                            {* Number of calls to system.    *}
  113.           HelpLevel,                        {* Helplevel (Nov,Reg,Exp).      *}
  114.           Tabs,                             {* Number of spaces pr. tab.     *}
  115.           Nulls,                            {* Number of nulls (delays).     *}
  116.           LastMsgArea,                      {* Message area last visited.    *}
  117.           Flags,                            {* Misc. flags for ANSI etc.     *}
  118.           Privilege:integer;                {* Privilege level (T,D,N,P..H)  *}
  119.           LastDate:String[19];              {* Last time on system (ASCII).  *}
  120.           TimeToday,                        {* Number of minutes used today. *}
  121.           BaudRate,                         {* Baudrate (Used with ^OC).     *}
  122.           Upload,                           {* Total upload in Kbytes.       *}
  123.           Download,                         {* Total download in Kbytes.     *}
  124.           Download_Now,                     {* Download this session in Kb.  *}
  125.           LastFileArea:integer;             {* File area last visited.       *}
  126.           ScreenWidth,                      {* Width of users monitor.       *}
  127.           ScreenLength:byte;                {* Hight of users monitor.       *}
  128.           Credit,                           {* Mail-credit in cents.         *}
  129.           Debit:integer;                    {* Mail-debit in cents.          *}
  130.         End;                                {*********************************}
  131.  
  132.   _UsrPtr = RECORD                           { For Use With UserFast routines }
  133.               _Ptr  : ARRAY[1..MaxUserRec] OF ^__Usr;
  134.               _Recs : Integer;
  135.             END;
  136.  
  137.  
  138.   {***************************************************************************}
  139.   {* OPUS MESSAGE HEADER Structure                                           *}
  140.   {***************************************************************************}
  141.  
  142. CONST
  143.   MaxTextLines = 300;    {* Absolute max number of msg lines                 *}
  144.   MsgPrivate   = $0001;  { Private Messages             * 0000 0000 0000 0001 }
  145.   MsgCrash     = $0002;  { Squirt Mail                  * 0000 0000 0000 0010 }
  146.   Msgread      = $0004;  { Read by addressee            * 0000 0000 0000 0100 }
  147.   MsgSent      = $0008;  { Sent OK (remote)               0000 0000 0000 1000 }
  148.   MsgFile      = $0010;  { File Attached to message     * 0000 0000 0001 0000 }
  149.   MsgFwd       = $0020;  { In Transit                     0000 0000 0010 0000 }
  150.   MsgOrphan    = $0040;  { Unknown Destination Node     * 0000 0000 0100 0000 }
  151.   MsgKill      = $0080;  { kill after bundling            0000 0000 1000 0000 }
  152.   MsgLocal     = $0100;  { FidoNet vs Local               0000 0001 0000 0000 }
  153.   MsgHold      = $0200;  { Hold Don't send              * 0000 0010 0000 0000 }
  154.   MsgXX2       = $0400;  { reserved                    X? 0000 0100 0000 0000 }
  155.   MsgFrq       = $0800;  { File request                 * 0000 1000 0000 0000 }
  156.   MsgRrq       = $1000;  { Receipt requested           X* 0001 0000 0000 0000 }
  157.   MsgCpt       = $2000;  { is a return receipt         X* 0010 0000 0000 0000 }
  158.   MsgArq       = $4000;  { Audit trail requested       X* 0100 0000 0000 0000 }
  159.   MsgUrq       = $8000;  { Update Request              X* 1000 0000 0000 0000 }
  160.                                                      {------------------------}
  161.                                                      {  ^                     }
  162.                                                      {  |                     }
  163.                                                      {   * = Preserved by     }
  164.                                                      {       the Network      }
  165.                                                      {   ? = Stripped by the  }
  166.                                                      {       net (FTSC spec)  }
  167.                                                      {       but preserved by }
  168.                                                      {       Seadog <TM>      }
  169.                                                      {   X = Not used by OPUS }
  170.                                                      {------------------------}
  171.  
  172. TYPE
  173.   _MsgHead = Record
  174.                _From:String[35];
  175.                _To:String[35];
  176.                _Subj:String[71];
  177.                _Date:String[19];
  178.                _Times:Integer;
  179.                _Dest:Integer;
  180.                _Orig:Integer;
  181.                _Cost:Integer;
  182.                _OrigNet:Integer;
  183.                _DestNet:Integer;
  184.                _Written:LongInt;
  185.                _Arived:LongInt;
  186.                _Reply:Integer;
  187.                _Attr:Word;
  188.                _Up:Integer;
  189.              End;
  190.  
  191.   _Msg = Record
  192.            _From:String[35];
  193.            _To:String[35];
  194.            _Subj:String[71];
  195.            _Date:String[19];
  196.            _Times:Integer;
  197.            _Dest:Integer;
  198.            _Orig:Integer;
  199.            _Cost:Integer;
  200.            _OrigNet:Integer;
  201.            _DestNet:Integer;
  202.            _Written:LongInt;
  203.            _Arived:LongInt;
  204.            _Reply:Integer;
  205.            _Attr:Word;
  206.            _Up:Integer;
  207.            Lines:ARRAY[1..MaxTextLines] OF _Lines;
  208.            NumberOfLines: Integer;
  209.          End;
  210.  
  211.   {***************************************************************************}
  212.   {* NODELIST                                                                *}
  213.   {***************************************************************************}
  214.   {*                                                                         *}
  215.   {* NodeList.Sys                                                            *}
  216.   {*                                                                         *}
  217.   {*   NET > 0 and NODE > 0    Normal node                                   *}
  218.   {*                                                                         *}
  219.   {*   NET > 0 and NODE <= 0   Host node                                     *}
  220.   {*                              Net host........node== 0                   *}
  221.   {*                              Regional host...node==-1                   *}
  222.   {*                              Country host....node==-2                   *}
  223.   {*                                                                         *}
  224.   {*   NET == -1      Nodelist.Sys revision                                  *}
  225.   {*                                                                         *}
  226.   {*   NET == -2      Nodelist statement                                     *}
  227.   {*                                                                         *}
  228.   {***************************************************************************}
  229.  
  230.   {---------------------------------------------------------------------------}
  231.   {- NODE   Old style (Nodelist Version 5)                                   -}
  232.   {---------------------------------------------------------------------------}
  233.  
  234.   _Node = RECORD
  235.             Number: Integer;               { Node number                      }
  236.             Net: Integer;                  { Net Number                       }
  237.             Cost: Integer;                 { cost of a message to this node   }
  238.             Rate: Integer;                 { Baud rate                        }
  239.             Name: STRING[19];              { Node Name                        }
  240.             Phone: STRING[39];             { Phone Number                     }
  241.             City: STRING[39];              { City and State                   }
  242.             Password: STRING[7];           { Password String                  }
  243.           END;
  244.  
  245. CONST
  246.  
  247.   {---------------------------------------------------------------------------}
  248.   {- Values for the `NodeFlags' field (Version 6 Nodelist, Binkley version)  -}
  249.   {---------------------------------------------------------------------------}
  250.  
  251.         B_hub    = $0001; { node is a net hub       0000 0000 0000 0001       }
  252.         B_host   = $0002; { node is a net host      0000 0000 0000 0010       }
  253.         B_region = $0004; { node is region coord    0000 0000 0000 0100       }
  254.         B_zone   = $0008; { node is a zone coord    0000 0000 0000 1000       }
  255.         B_CM     = $0010; { runs continuous mail    0000 0000 0001 0000       }
  256.         B_ores1  = $0020; { reserved for Opus       0000 0000 0010 0000       }
  257.         B_ores2  = $0040; { reserved for Opus       0000 0000 0100 0000       }
  258.         B_ores3  = $0080; { reserved for Opus       0000 0000 1000 0000       }
  259.         B_ores4  = $0100; { reserved for Opus       0000 0001 0000 0000       }
  260.         B_ores5  = $0200; { reserved for Opus       0000 0010 0000 0000       }
  261.         B_res1   = $0400; { reserved for non-Opus   0000 0100 0000 0000       }
  262.         B_res2   = $0800; { reserved for non-Opus   0000 1000 0000 0000       }
  263.         B_res3   = $1000; { reserved for non-Opus   0001 0000 0000 0000       }
  264.         B_res4   = $2000; { reserved for non-Opus   0010 0000 0000 0000       }
  265.         B_res5   = $4000; { reserved for non-Opus   0100 0000 0000 0000       }
  266.         B_res6   = $8000; { reserved for non-Opus   1000 0000 0000 0000       }
  267.  
  268.   {---------------------------------------------------------------------------}
  269.   {- NODE   New style (Nodelist Version 6) (Stolen from Binkley)             -}
  270.   {---------------------------------------------------------------------------}
  271.  
  272. TYPE
  273.   _NewNode = RECORD
  274.                Number: Word;         { Node number                            }
  275.                Net: Word;            { Net Number                             }
  276.                Cost: Word;           { cost of a message to this node         }
  277.                Rate: Integer;        { Baud rate                              }
  278.                Name: STRING[33];     { Node Name                              }
  279.                Phone: STRING[39];    { Phone Number                           }
  280.                City: STRING[29];     { City and State                         }
  281.                Password: STRING[8];  { Password String                        }
  282.                RealCost: Word;    { Phone company's charge                 }
  283.                HubNode: Word;        { node # of this node's hub or 0 if none }
  284.                ModemType: Byte;      { RESERVED for Modem Type                }
  285.                NodeFlags: Word;      { Set of flags (See above)               }
  286.              END;
  287.  
  288.   {---------------------------------------------------------------------------}
  289.   {- Nodelist.Idx  File is terminated by EOF                                 -}
  290.   {---------------------------------------------------------------------------}
  291.  
  292.   _ndi = Record
  293.            Node: INTEGER;                 { Node Number                       }
  294.            Net: INTEGER;                  { Net Number                        }
  295.          END;
  296.  
  297.   {***************************************************************************}
  298.   {* OPUS CONTROL FILE AND PARM FILE DECLARATIONS                            *}
  299.   {*************************************************************************-*}
  300.  
  301. CONST
  302.   CTL_VERSION=14;                        { OPUS Control file version          }
  303.   MAX_EXTERN=8;                          { Max external programs              }
  304.   MAXCLASS=12;                           { Number of possible priv levels     }
  305.  
  306.   {---------------------------------------------------------------------------}
  307.   {- Multitaskers (possible values for  'ctl.multitasker' 0 = no multask     -}
  308.   {---------------------------------------------------------------------------}
  309.  
  310.   DoubleDos = 1;
  311.   DesqView = 2;
  312.   TopView = 3;
  313.   TaskView = 4;
  314.   MsWindows = 5;
  315.  
  316.   {---------------------------------------------------------------------------}
  317.   {- Matrix Mask   Undefined bits are reserved for OPUS                      -}
  318.   {---------------------------------------------------------------------------}
  319.  
  320.   No_Traffic = $0001;   { OK to send outbound lokal      0000 0000 0000 0001  }
  321.   Local_Only = $0002;   { ok to send Outbound local      0000 0000 0000 0010  }
  322.   Opus_Only  = $0002;   { only send to #CM systems       0000 0000 0000 0100  }
  323.  
  324.   No_Exits   = $2000;   { Crash/Arc exits ignored        0010 0000 0000 0000  }
  325.   Mail_Only  = $4000;   { no human callers allowed       0100 0000 0000 0000  }
  326.   Take_Req   = $8000;   { File requests are OK           1000 0000 0000 0000  }
  327.  
  328.   {---------------------------------------------------------------------------}
  329.   {- Flags                                                                   -}
  330.   {---------------------------------------------------------------------------}
  331.  
  332.   Logecho    = $0001;   { Log echoMail areas.            0000 0000 0000 0001  }
  333.   Steady     = $0002;   { never change baudrate          0000 0000 0000 0010  }
  334.  
  335.  
  336. TYPE
  337.  
  338.   {---------------------------------------------------------------------------}
  339.   {- Information about a class of users.  (Unstable Structure)               -}
  340.   {---------------------------------------------------------------------------}
  341.  
  342.   Class_Rec = RECORD
  343.                 Priv: INTEGER;
  344.                 Max_Time: INTEGER;        { Max cume time per day             }
  345.                 Max_Call: INTEGER;        { Max time for one call             }
  346.                 Max_DL: INTEGER;          { Max download bytes per day        }
  347.                 Ratio: WORD;              { ul:dl ratio                       }
  348.                 Min_Baud: WORD;           { Speed needed for logon            }
  349.                 Min_File_Baud: WORD;      { Speed needed for xfer             }
  350.               END;
  351.  
  352.   {---------------------------------------------------------------------------}
  353.   {- The structure of a PRM file          (Unstable Structure)               -}
  354.   {-                                                                         -}
  355.   {- Please notice the Version Number at offset zero.                        -}
  356.   {---------------------------------------------------------------------------}
  357.  
  358.   _Prm = RECORD
  359.            Version: BYTE;                 { For Safety                        }
  360.            TestMode: BYTE;                { Input From KeyBoard, Not Modem    }
  361.       {-}  TotalCallers: LongInt;         { Total Number of callers to system }
  362.       {-}  QuotePosition: LongInt;        { Last position in Quote file       }
  363.            Multitasker: BYTE;             { Multitasker Type  See up Front    }
  364.            Snooping: BYTE;                { Local Monitor Active              }
  365.            EditExit: BYTE;                { 1= Use newuser questionaire       }
  366.            Verbose: BYTE;                 { Wordy SysOp Log                   }
  367.            Terse: BYTE;                   { Brief SysOp Log                   }
  368.            Trace: BYTE;                   { Log trace mode                    }
  369.            ShowAreaPath: BYTE;            { use path not DIR.BBS              }
  370.            TaskNum: BYTE;                 { Task number for multitask Systems }
  371.            ExitVal: BYTE;                 { ERRORLEVEL to use after caller    }
  372.            ValOutside: BYTE;              { ERRORLEVEL for O)utside           }
  373.            ValZero: BYTE;                 { ERRORLEVEL for SysOp O) command   }
  374.            NoCrashmail: BYTE;             { 1= Don't accept Crashmail         }
  375.            AutoKill: BYTE;                { RECD PVT msgs. 0=no, 1=ask, 2=yes }
  376.            CrashExit: BYTE;               { non zere = Errorlevel exit        }
  377.            UnpackArc: BYTE;               { 1= Unpack incomming arcmail       }
  378.            TossEcho: BYTE;                { 1=Toss incomming echomail         }
  379.            ArcExit: BYTE;                 { ERRORLEVEL for after rec. arcmail }
  380.            UseDTR: BYTE;                  { 1 = DROP dtr look busy,0 off hook }
  381.            CarrierMask: INTEGER;          {                                   }
  382.            HandshakeMask: INTEGER;        {                                   }
  383.            CtlaPriv: INTEGER;             { Privil to se ^A lines in msgs     }
  384.            MaxBaud: INTEGER;              { Fastest speed we can use          }
  385.            MinBaud: INTEGER;              { Min baud rate to get online       }
  386.            SpeedGraphics: INTEGER;        { Min Baud for graphics             }
  387.            ComPort:INTEGER;               { 0=COM1, 1=COM2 ...                }
  388.            LogonPriv:INTEGER;             { Accesslevel for new users         }
  389.            DateStyle: INTEGER;            { Used for files.BBS display        }
  390.            SeenPriv: INTEGER;             { Minimum priv to see SEEN-BY line  }
  391.  
  392.            MsgAsk: ARRAY[1..16] OF INTEGER;        { Array of Privs. for      }
  393.                                                    { Massage attr ask's       }
  394.            MsgAssume: ARRAY[1..16] OF INTEGER;        { Array of Privs. for   }
  395.                                                       { Massage attr assumes  }
  396.            MsgFromfile:INTEGER;           { Priv for doing msg from file      }
  397.  
  398.            WatchDog: BYTE;                { 1=set Fossil to reboot during Out }
  399.            Video: BYTE;                   { 0=DOS, 1=FOSSIL, 2=IBM            }
  400.  
  401.       {-}  Filler: ARRAY[1..11] OF BYTE;
  402.  
  403.       {-}  BFill: BYTE;
  404.            Flags: BYTE;                   { Flags def up front                }
  405.  
  406.            OurZone: WORD;                 { The current Zone                  }
  407.            MatrixMask: WORD;              { Look Up Front                     }
  408.  
  409.            ClassRec: ARRAY[1..MAXCLASS] OF Class_Rec;        { Class Records  }
  410.            Alias: ARRAY[1..15] OF _ndi;         { Node Numbers / Aliasses     }
  411.  
  412.            MInit: _Str;                    { Modem init string                }
  413.            PreDial: _Str;                  { dial prefix sent before number   }
  414.            PostDial: _Str;                 { Sent after number                }
  415.            TimeFormat: _Str;               { Look in BBS.CTL file             }
  416.            DateFormat: _Str;               { Look in BBS.CTL file             }
  417.            FkeyPath: _Str;                 { Path to f-key files              }
  418.            ParmOutside: _Str;              { Prog/Parms for outside file      }
  419.            ParmZero: _Str;                 { Parm for sysop O) command        }
  420.            SysPath: _Str;                  { Path to system??.BBS files       }
  421.            UserFile: _Str;                 { Path/filename to User.BBS file   }
  422.            NetInfo: _Str;                  { Path to nodelist                 }
  423.            SchedName: _Str;                { Name of SCHED FILE               }
  424.            Logo: _Str;                     { First file shown to caller       }
  425.            Welcome: _Str;                  { Shown after logon                }
  426.            Bulletin: _Str;                 { Shown after Welcome file         }
  427.            Edtorial: _Str;                 { Edtorial Menu file               }
  428.            Quote: _Str;                    { File containing Quotes           }
  429.            Question: _Str;                 { Questionaire available main menu }
  430.            RequestList: _Str;              { List of files approved for f.req }
  431.            Newuser1: _Str;                 { Shown before new user enters PW  }
  432.            Newuser2: _Str;                 { Shown after new user enters Passw}
  433.            Rookie: _Str;                   { Shown too rookies after Pasword  }
  434.            Application: _Str;              { New user questionaire            }
  435.            AvailList: _Str;                { File List FILES (f.req)          }
  436.            HlpEditor: _Str;                { Intro to msg editor              }
  437.            HlpReplace: _Str;               { Explain MSG editor E)dit command }
  438.            MsgInquire: _Str;               { Explain MSG I)nquire command     }
  439.            HlpLocate: _Str;                { Explain File L)ocate command     }
  440.            HlpContents: _Str;              { Explain the files contents comm  }
  441.            OutLeaving: _Str;               { Bon Voyage a l'outside           }
  442.            OutReturn: _Str;                { Welcome back from outside        }
  443.            DayLimit: _Str;                 { Sorry, You've been to long....   }
  444.            TimeWarn: _Str;                 { Warning about forced hangup      }
  445.            SysOp: _Str;                    { SysOp's name                     }
  446.            TooSlow: _Str;                  { Explains min logon baud.         }
  447.            Xferbaud: _Str;                 { Explains min file transf baud    }
  448.            MsgAreaList: _Str;              { Dump file instead of DIR.BBS     }
  449.            FileAreaList: _Str;             { Dump file instead of Dir.BBS     }
  450.            MailListFile: _Str;             { Default nodelist file            }
  451.            ByeBye: _Str;                   { Displayed at logoff              }
  452.            FileProt1: _Str;                { Some external file protocols     }
  453.            FileProt2: _Str;
  454.            FileProt3: _Str;
  455.            FileProt4: _Str;
  456.            FileProt5: _Str;
  457.            FileProt6: _Str;
  458.            FileProt7: _Str;
  459.            FileProt8: _Str;
  460.            LocalEditor: _Str;              { SysOps Local Editor              }
  461.            FileMgt: _Str;                  { External File Section Management }
  462.            HoldArea: _Str;                 { Path to Outbound area            }
  463.            Barricade: _Str;
  464.            Badaccess: _Str;
  465.            MsgMgt: _Str;                   { External Message section mgt     }
  466.            MailPath: _Str;                 { Path to inbound bundles (MATRIX) }
  467.            FilePath: _Str;                 { Path for inbound matrix files    }
  468.            OpedHelp: _Str;                 { OpEd help file                   }
  469.            TempPath: _Str;                 { Place to put temporary files     }
  470.            ModemBusy: _Str;                { Modem Busy String                }
  471.            SystemName: _Str;               { System name string               }
  472.            AboutFile: _Str;                { System Info file (About File)    }
  473.            LogName: _Str;                  { Log File Name                    }
  474.          END;
  475.  
  476.   {***************************************************************************}
  477.   {* OPUS SCHEDule file Structure                                            *}
  478.   {***************************************************************************}
  479.  
  480. CONST
  481.   MaxScheds  = 35;       {* Maximum number of events                         *}
  482.   ExtEvent   = 'X';      {* External event (return to Dos)                   *}
  483.   YellEvent  = 'Y';      {* Yell event (when yell is on)                     *}
  484.   ForceEvent = $0001;    {* Force this event.                                *}
  485.   CleanHold  = $0001;    {* This Z-Event is a house cleaning event           *}
  486.  
  487. TYPE
  488.   _Sched = Record
  489.               Year: Word;       {* Usable but doesn't make much sense        *}
  490.               Month: Word;      {* Month of the current event                *}
  491.               Day: Word;        {* Day of the Month                          *}
  492.               DayWk: Word;      {* Day of the week 0=Sun, 6=Sat, 7=all.      *}
  493.               Hour: Word;       {* 0..23   Starting hour                     *}
  494.               Min: Word;        {* 0..59   Starting minute                   *}
  495.               Sec: Word;        {* Unused                                    *}
  496.               Len: Word;        {* Length of the event                       *}
  497.               Enable: Integer;  {* 1= enabled                                *}
  498.               Trigger: Word;    {* Unknown/Unused                            *}
  499.               Result: Word;     {* X errorlevel, Y duration of Bell          *}
  500.               Tag: Char;        {* Event Type 'A' .. 'Z'                     *}
  501.               Junk_1: Byte;     {* Dummy                                     *}
  502.               Last_ran: Word;   {* Day of month when event was executed last *}
  503.               B: Word;          {* Reserved for OPUS                         *}
  504.               C: Word;          {* Reserved for external utilities           *}
  505.               Behavior: Word;   {* Behavior of Z events.  See tabble earlier *}
  506.               EventMask: Byte;  {* Force this event                          *}
  507.               GMT: Byte;        {* Set = GMT, Clear = Local time             *}
  508.            END;
  509.  
  510.   {---------------------------------------------------------------------------}
  511.   {- Z-Event Behavior...                                                     -}
  512.   {-  IF RESULT = 1, The 'behavior' field contains a "Matrix Mask". Those    -}
  513.   {-                 are described in the PRM definations.                   -}
  514.   {-  IF RESULT = 2, It is an internal hausecleaning event.                  -}
  515.   {---------------------------------------------------------------------------}
  516.  
  517.   _Scheds = ARRAY[1..MaxScheds] OF _Sched;
  518.  
  519. FUNCTION OpIntERROR: Integer;      { ERROR Variable Check this Allways }
  520.     {*************************************************************************}
  521.     {*  ERROR Returns                                                        *}
  522.     {*                                                                       *}
  523.     {*  0 = Everything is Bright and Sunny, Just go on                       *}
  524.     {*  2 = File not found, Check your filename                              *}
  525.     {*  3 = Path not found, Check your pathname                              *}
  526.     {*  4 = Too many open files, We need one extra file.                     *}
  527.     {*  5 = Fileaccess denied, Check file status.                            *}
  528.     {*  12 = Invalid file acces code.                                        *}
  529.     {*  100 = Disk read error.                                               *}
  530.     {*  101 = Disk write error.                                              *}
  531.     {*  190 = Fossil is not loaded.                                          *}
  532.     {*  191 = Unable to find carrier.                                        *}
  533.     {*  192 = Carrier on current port has changed.                           *}
  534.     {*  193 = Timeout reading port.                                          *}
  535.     {*  194 = Timeout writing port.                                          *}
  536.     {*  200 = .PRM file is to big ( > 8 KB )                                 *}
  537.     {*  201 = Wrong CTL file version, You need another OPUS_CTL              *}
  538.     {*  202 = To much data for the .PRM file ( > 8 KB )                      *}
  539.     {*  210 = .MSG file is to big ( > 8 KB )                                 *}
  540.     {*  211 = To many lines in message                                       *}
  541.     {*  212 = To many charecters to write message                            *}
  542.     {*  220 = Cannot find User record                                        *}
  543.     {*  221 = To Many Records In UserFile                                    *}
  544.     {*  222 = Not Room For Extra User Record in The Structure                *}
  545.     {*  230 = Cannot find Nodelist Record                                    *}
  546.     {*  231 = Cannot find Nodelist Index Record                              *}
  547.     {*  250 = Illegal Date / Time specified.                                 *}
  548.     {*************************************************************************}
  549.  
  550. FUNCTION IOResult: INTEGER;
  551.   {***************************************************************************}
  552.   {* Return First OpInt Or I/O Error that occured.. look at OpIntERROR and   *}
  553.   {* TPAS Manual for error description                                       *}
  554.   {***************************************************************************}
  555.  
  556. FUNCTION UpperCase(S: String):String;
  557.   {***************************************************************************}
  558.   {* Converts Strings to uppercase...                                        *}
  559.   {***************************************************************************}
  560.  
  561. FUNCTION LowerCase(S: String):String;
  562.   {***************************************************************************}
  563.   {* Converts strings to lovercase...                                        *}
  564.   {***************************************************************************}
  565.  
  566. FUNCTION SmartCase(S: String):String;
  567.   {***************************************************************************}
  568.   {* Converts string to First letter in word to Uppercase, rest to lovercase *}
  569.   {***************************************************************************}
  570.  
  571. FUNCTION GetEnvStr(S:String):String;
  572.   {***************************************************************************}
  573.   {* Return the EnvironMent String for the the Variabel S                    *}
  574.   {*  S Must be in Uppercase.                                                *}
  575.   {***************************************************************************}
  576.  
  577. FUNCTION GMT_Difference:Integer;
  578.   {***************************************************************************}
  579.   {* Return an integer value of the difference from GMT (Uses TZ env var.)   *}
  580.   {***************************************************************************}
  581.  
  582. PROCEDURE GetDateTime(VAR DT:DateTime);
  583.   {***************************************************************************}
  584.   {* Return a DateTime structure containing the current Date and Time.       *}
  585.   {***************************************************************************}
  586.  
  587. FUNCTION DaysThisYear(DT: DateTime):Integer;
  588.   {***************************************************************************}
  589.   {* Give day number for the date specified in DT. (Note Year >= 1980)       *}
  590.   {***************************************************************************}
  591.  
  592. FUNCTION PackUnixDate(DT:DateTime):LongInt;
  593.   {***************************************************************************}
  594.   {* Return number of Seconds since 1/1-1970                                 *}
  595.   {***************************************************************************}
  596.  
  597. PROCEDURE UnpackUnixDate(Date:LongInt; Var DT:DateTime);
  598.   {***************************************************************************}
  599.   {* Convert number of Seconds since 1/1-1970 to DateTime type.              *}
  600.   {***************************************************************************}
  601.  
  602. FUNCTION PackDateString(DT:DateTime): String;
  603.   {***************************************************************************}
  604.   {* Return a string containing Time and Date from DT                        *}
  605.   {* The format of the Date/Time string will be:                             *}
  606.   {*   'dd-mon-yy hh:mm:ss'                                                  *}
  607.   {*      Ex. '24-May-88 12:22:21'                                           *}
  608.   {***************************************************************************}
  609.  
  610. PROCEDURE UnpackDateString(S:String;Var DT:DateTime);
  611.   {***************************************************************************}
  612.   {* This Procedure will return the contents of a Date/time string in DT.    *}
  613.   {* The format of the Date/Time string Must be:                             *}
  614.   {*   'dd-mon-yy hh:mm:ss'                                                  *}
  615.   {*      Ex. '24-May-88 12:22:21'                                           *}
  616.   {***************************************************************************}
  617.  
  618. FUNCTION PackDateStrLog(DT:DateTime): String;
  619.   {***************************************************************************}
  620.   {* Return a string containing Time and Date from DT  In LOG file Format    *}
  621.   {***************************************************************************}
  622.  
  623. PROCEDURE AddLog(name:STRING; Flag: _StrSys; Subject: STRING);
  624.  
  625.   {***************************************************************************}
  626.   { Add String in S to LogFile. With Date And Time Flag will contain prefix  *}
  627.   {***************************************************************************}
  628.  
  629. PROCEDURE SetAttrib(Var Attribute; Flag: Word; Status:Boolean);
  630.   {***************************************************************************}
  631.   {*  This procedure will change an attribute flag.                          *}
  632.   {*  WARNING: 'Attribute' MUST be of type 'Word' or of Type 'Integer'...    *}
  633.   {***************************************************************************}
  634.  
  635. PROCEDURE ReadPrm(name:String; VAR Prm:_Prm);
  636.   {***************************************************************************}
  637.   {* ReadPrm reads the PRM file 'name' to the Variable 'Prm'                 *}
  638.   {***************************************************************************}
  639.  
  640. PROCEDURE WritePrm(name:String; VAR Prm:_Prm);
  641.   {***************************************************************************}
  642.   {* WritePrm writes the PRM file 'name' with the contents of 'Prm'          *}
  643.   {***************************************************************************}
  644.  
  645. PROCEDURE ReadScheds(name:String; VAR Scheds:_Scheds);
  646.   {***************************************************************************}
  647.   {* ReadScheds reads the SCHEDULE file 'name' to the Vaiable 'Scheds'       *}
  648.   {***************************************************************************}
  649.  
  650. PROCEDURE WriteScheds(name:String; VAR Scheds:_Scheds);
  651.   {***************************************************************************}
  652.   {* WriteScheds Rewrites the SCHEDULE file 'name' with the Vaiable 'Scheds' *}
  653.   {***************************************************************************}
  654.  
  655. PROCEDURE ReadSys(name:String; VAR Sys:_Sys);
  656.   {***************************************************************************}
  657.   {* ReadSys reads the SYSTEM??.BBS file 'name' to the Vaiable 'Sys'         *}
  658.   {***************************************************************************}
  659.  
  660. PROCEDURE WriteSys(name:String; VAR Sys:_Sys);
  661.   {***************************************************************************}
  662.   {* WriteSys Rewrites the SYSTEM*.BBS file 'name' with the contents of 'Sys'*}
  663.   {***************************************************************************}
  664.  
  665. PROCEDURE ReadUser(name:String; VAR Usr:_Usr;Rec: WORD);
  666.   {***************************************************************************}
  667.   {* This procedure will read a user record from the file 'name' to the      *}
  668.   {* structure Usr, it will return the user record number 'rec'              *}
  669.   {***************************************************************************}
  670.  
  671. PROCEDURE WriteUser(name:String; VAR Usr:_Usr;Rec: WORD);
  672.   {***************************************************************************}
  673.   {* This procedure will write a user record to the file 'name'.             *}
  674.   {* the variable Usr will be written to the user record number 'rec'.       *}
  675.   {***************************************************************************}
  676.  
  677. FUNCTION NumberOfUsers(Name:String):Word;
  678.   {***************************************************************************}
  679.   {*  Will return the number of users in the DiskFile 'Name'                 *}
  680.   {***************************************************************************}
  681.  
  682. PROCEDURE InitUserPtr(VAR UsrPtr:_UsrPtr);
  683.   {***************************************************************************}
  684.   {* Initialise the UsrPointer.. Must be called if you create a new userfile *}
  685.   {* Using the followin User Management Procedures and functions.            *}
  686.   {***************************************************************************}
  687.  
  688. PROCEDURE ReadUserFast(VAR UsrPtr:_UsrPtr; VAR Usr:_Usr; Recs: INTEGER);
  689.   {***************************************************************************}
  690.   {* This procedure will read a user records from the menory pool of _UsrPtr *}
  691.   {***************************************************************************}
  692.  
  693. PROCEDURE WriteUserFast(VAR UsrPtr:_UsrPtr;VAR Usr:_Usr; Recs: INTEGER);
  694.   {***************************************************************************}
  695.   {* This procedure will write one of the user records into menory           *}
  696.   {***************************************************************************}
  697.  
  698. PROCEDURE ReleaseUserPtr(VAR UsrPtr:_UsrPtr);
  699.   {***************************************************************************}
  700.   {* Release the Heap space used by the UsrPointer variable.                 *}
  701.   {***************************************************************************}
  702.  
  703. PROCEDURE DelUserPtr(VAR UsrPtr:_UsrPtr; Rec:Integer);
  704.   {***************************************************************************}
  705.   {* Delete Single UserRecord From Memory and Release The Space Too          *}
  706.   {***************************************************************************}
  707.  
  708. PROCEDURE InsUserPtr(VAR UsrPtr:_UsrPtr; VAR Usr:_Usr; Rec:Integer);
  709.   {***************************************************************************}
  710.   {* Insert New UserRecord In Heap as Number Rec.                            *}
  711.   {***************************************************************************}
  712.  
  713. PROCEDURE ReadUserFile(name:String; VAR UsrPtr:_UsrPtr; VAR Recs: INTEGER);
  714.   {***************************************************************************}
  715.   {* This procedure will read all the user records from the file 'name' into *}
  716.   {* memory                                                                  *}
  717.   {***************************************************************************}
  718.  
  719. PROCEDURE WriteUserFile(name:String; VAR UsrPtr:_UsrPtr);
  720.   {***************************************************************************}
  721.   {* This procedure will write all users in the memory pool wich is used by  *}
  722.   {* UsrPtr.  It will be written to the file 'Name'.                         *}
  723.   {***************************************************************************}
  724.  
  725. PROCEDURE ReadNode(name:String; VAR Node:_Node;Rec: LongInt);
  726.   {***************************************************************************}
  727.   {* This procedure will read a Node record from the file 'name' to the      *}
  728.   {* structure Node, it will return the user record number 'rec'             *}
  729.   {***************************************************************************}
  730.  
  731. PROCEDURE WriteNode(name:String; VAR Node:_Node;Rec: LongInt);
  732.   {***************************************************************************}
  733.   {* This procedure will write a Node record to a version 5 nodelist file    *}
  734.   {***************************************************************************}
  735.  
  736. PROCEDURE ReadNewNode(name:String; VAR NewNode:_NewNode;Rec: LongInt);
  737.   {***************************************************************************}
  738.   {* This procedure will read a Node record from the file 'name' to the      *}
  739.   {* structure Node, it will return the user record number 'rec'             *}
  740.   {* For Use with nodelist version 6.                                        *}
  741.   {***************************************************************************}
  742.  
  743. PROCEDURE WriteNewNode(name:String; VAR NewNode:_NewNode;Rec: LongInt);
  744.   {***************************************************************************}
  745.   {* This procedure will write a Node record to a version 6 nodelist file    *}
  746.   {***************************************************************************}
  747.  
  748. FUNCTION NumberOfNodes(Name:String):LongInt;
  749.   {***************************************************************************}
  750.   {*  Will return the number of users in the Nodelist.IDX file 'Name'        *}
  751.   {***************************************************************************}
  752.  
  753. FUNCTION FindNode(name:String;Net,Node: Integer):LongInt;
  754.   {***************************************************************************}
  755.   {* FIND Nodelist Entry number                                              *}
  756.   {*    name :        Name of Nodelist Index file                            *}
  757.   {*    _net,_node :  Net and Nodenumber                                     *}
  758.   {***************************************************************************}
  759.  
  760. PROCEDURE ReadNdi(name:String; VAR Ndi:_Ndi;Rec: LongInt);
  761.   {***************************************************************************}
  762.   {* This procedure will read a Ndi record from the file 'name' to the       *}
  763.   {* structure Ndi, it will return the user record number 'rec'              *}
  764.   {***************************************************************************}
  765.  
  766. PROCEDURE WriteNdi(name:String; VAR Ndi:_Ndi;Rec: LongInt);
  767.   {***************************************************************************}
  768.   {* This procedure will write a Node record to a nodeliste index file. The  *}
  769.   {* record number written is 'rec'                                          *}
  770.   {***************************************************************************}
  771.  
  772. FUNCTION MsgLength(VAR Msg:_Msg):LongInt;
  773.   {***************************************************************************}
  774.   {*  This function will return the number of charecters in the Message Msg  *}
  775.   {***************************************************************************}
  776.  
  777. PROCEDURE ReadMsg(name:String; VAR Msg:_Msg);
  778.   {***************************************************************************}
  779.   {* This procedure will read a message with file name 'name' and return     *}
  780.   {* the header and Text in the structure Msg                                *}
  781.   {***************************************************************************}
  782.  
  783. PROCEDURE WriteMsg(name:String; VAR Msg:_Msg);
  784.   {***************************************************************************}
  785.   {* This procedure will write a message to a file name 'name' from  the     *}
  786.   {* variable Msg.                                                           *}
  787.   {***************************************************************************}
  788.  
  789. PROCEDURE ReadMsgHead(name:String; VAR Msg:_Msg);
  790.   {***************************************************************************}
  791.   {* This procedure will read a message with file name 'name' and return     *}
  792.   {* the header in the structure Msg, The Msg body will not be read          *}
  793.   {***************************************************************************}
  794.  
  795. PROCEDURE WriteMsgHead(name:String; VAR Msg:_Msg);
  796.   {***************************************************************************}
  797.   {* This procedure will write a message in the file named 'name'.           *}
  798.   {* The Msg body will not be changed.                                       *}
  799.   {***************************************************************************}
  800.  
  801. PROCEDURE ReadMsgHeadNew(name:String; VAR MsgHead:_MsgHead);
  802.   {***************************************************************************}
  803.   {* This procedure will read a message with file name 'name' and return     *}
  804.   {* the header in the structure MsgHead, The Msg body will not be read.     *}
  805.   {***************************************************************************}
  806.  
  807. PROCEDURE WriteMsgHeadNew(name:String; VAR MsgHead:_MsgHead);
  808.   {***************************************************************************}
  809.   {* This procedure will write a message in the file named 'name'.           *}
  810.   {* The Msg body will not be changed.                                       *}
  811.   {***************************************************************************}
  812.  
  813. FUNCTION FirstFreeMsg(Path:String):String;
  814.   {***************************************************************************}
  815.   {*  This function will return the first free message number in the area    *}
  816.   {* described by path.                                                      *}
  817.   {***************************************************************************}
  818.  
  819. PROCEDURE SetMsgAttr(Var Attribute: Word; Flag: Word; Status:Boolean);
  820.   {***************************************************************************}
  821.   {*  This procedure will change the message attribute for a message         *}
  822.   {***************************************************************************}
  823.  
  824. {#############################################################################}
  825. {#                                                                           #}
  826. {#      Here are some functions wich normaly are placed in the CRT unit      #}
  827. {#                                                                           #}
  828. {#############################################################################}
  829.  
  830. PROCEDURE Delay(MS: Word);
  831.   {***************************************************************************}
  832.   {* Delay for MS milliseconds                                               *}
  833.   {***************************************************************************}
  834.  
  835. FUNCTION KeyPressed: Boolean;
  836.   {***************************************************************************}
  837.   {* Return true if a key has been pressed                                   *}
  838.   {***************************************************************************}
  839.  
  840. FUNCTION ReadKey: Char;
  841.   {***************************************************************************}
  842.   {* Read a Character from standard input                                    *}
  843.   {***************************************************************************}
  844.  
  845. {#############################################################################}
  846. {#                                                                           #}
  847. {#        F O S S I L   C O M U N I C A T I O N   =  O P - C O M             #}
  848. {#                                                                           #}
  849. {#############################################################################}
  850.  
  851. CONST
  852.   _MaxPort = 3;          {* The highest port number (0..x)                   *}
  853.   _On = True;
  854.   _Off = False;
  855.  
  856. VAR
  857.   _Snoop:       Boolean; {* Snoop Mode On or Off (Default is Off)            *}
  858.   _KeyBoard:    Boolean; {* KeyBoard Mode On or Off (Default is Off)         *}
  859.   _ExitCarrier: Byte;    {* Exit program on changed Carrier (Default is off) *}
  860.   _EightBit:    Boolean; {* Use 7 bit (Off) or 8 bits (On)  (Default is On)  *}
  861.   _ForceCom:    Boolean; {* Force write to Com port even if no carrier (off) *}
  862.  
  863. PROCEDURE SetBaud(BaudRate:Word);
  864.   {***************************************************************************}
  865.   {* Sets the baudrate using FOSSIL function $0                              *}
  866.   {***************************************************************************}
  867.  
  868. PROCEDURE ComSend(C:char);
  869.   {***************************************************************************}
  870.   {* Sends a single character to COM using FOSSIL function $1                *}
  871.   {***************************************************************************}
  872.  
  873. FUNCTION ComIn:char;
  874.   {***************************************************************************}
  875.   {* Reads a single character from COM using FOSSIL function $2              *}
  876.   {***************************************************************************}
  877.  
  878. FUNCTION InitPort(_Port:integer):boolean;
  879.   {***************************************************************************}
  880.   {* Initializes the specified COMport using function $4                     *}
  881.   {* This function will be true if there is a FOSSIL loaded                  *}
  882.   {***************************************************************************}
  883.  
  884. PROCEDURE DeInitPort(_Port:integer);
  885.   {***************************************************************************}
  886.   {* Deinitializes the specified COMport using function $5                   *}
  887.   {***************************************************************************}
  888.  
  889. FUNCTION BufferEmpty:boolean;
  890.   {***************************************************************************}
  891.   {* True if the outputbuffer is empty                                       *}
  892.   {***************************************************************************}
  893.  
  894. FUNCTION BufferReady:boolean;
  895.   {***************************************************************************}
  896.   {* False if the outputbuffer is full                                       *}
  897.   {***************************************************************************}
  898.  
  899. FUNCTION ComGot:boolean;
  900.   {***************************************************************************}
  901.   {* True if a character is available in the inputbuffer.                    *}
  902.   {***************************************************************************}
  903.  
  904. FUNCTION Carrier:boolean;
  905.   {***************************************************************************}
  906.   {* True if carrier is present.                                             *}
  907.   {***************************************************************************}
  908.  
  909. PROCEDURE SetDtr(_B:boolean);
  910.   {***************************************************************************}
  911.   {* Sets the DataTerminalReady Pin according to the boolean.                *}
  912.   {***************************************************************************}
  913.  
  914. PROCEDURE FlushOut;
  915.   {***************************************************************************}
  916.   {* Waits for the outputbuffer to be emptied ( Use with care ).             *}
  917.   {***************************************************************************}
  918.  
  919. PROCEDURE PurgeOut;
  920.   {***************************************************************************}
  921.   {* Empties the outputbuffer.                                               *}
  922.   {***************************************************************************}
  923.  
  924. PROCEDURE PurgeIn;
  925.   {***************************************************************************}
  926.   {* Empties the inputbuffer.                                                *}
  927.   {***************************************************************************}
  928.  
  929. FUNCTION KbdIn:char;
  930.   {***************************************************************************}
  931.   {* Reads a character from keyboard (wait if none available).               *}
  932.   {***************************************************************************}
  933.  
  934. PROCEDURE ScreenWrite(C:char);
  935.   {***************************************************************************}
  936.   {* Writes a character to screen throug the ANSI driver.                    *}
  937.   {***************************************************************************}
  938.  
  939. PROCEDURE SetWatchdg(_B:boolean);
  940.   {***************************************************************************}
  941.   {* Enables/disables the 'boot machine if carrier lost' watchdog            *}
  942.   {***************************************************************************}
  943.  
  944. PROCEDURE SendChar(C:char);
  945.   {***************************************************************************}
  946.   {* This routine will send the character to the selected port and if snoop  *}
  947.   {* or keyboard mode to the screen.                                         *}
  948.   {***************************************************************************}
  949.  
  950. FUNCTION ReadCom:char;
  951.   {***************************************************************************}
  952.   {* This routine gets a single character from the keyboard or seriel port   *}
  953.   {***************************************************************************}
  954.  
  955. PROCEDURE GetPort(VAR ComPort:Integer);
  956.   {***************************************************************************}
  957.   {* This Procedure will return the number of the current active port.       *}
  958.   {***************************************************************************}
  959.  
  960. PROCEDURE SetPort(ComPort:Integer);
  961.   {***************************************************************************}
  962.   {* This procedure will set a port to be active.                            *}
  963.   {***************************************************************************}
  964.  
  965. PROCEDURE InitFossil(ComPort,BaudRate:Integer);
  966.   {***************************************************************************}
  967.   {* This function will initialize a Com port for FOSSIL operation.          *}
  968.   {***************************************************************************}
  969.  
  970. PROCEDURE FindPort;
  971.   {***************************************************************************}
  972.   {* Searches COM1..COM4 for carrier and if carrier is found that port will  *}
  973.   {* port will be initialized and used. If no carrier found COM1 will be     *}
  974.   {* selected, and OpIntERROR variable will be set to 190.                   *}
  975.   {***************************************************************************}
  976.  
  977. PROCEDURE UseFossil;
  978.   {***************************************************************************}
  979.   {* This function will initialize a Com port for FOSSIL operation.          *}
  980.   {* It will find the first Com Port with Carrier and use this.              *}
  981.   {***************************************************************************}
  982.  
  983. PROCEDURE SafeFlush;
  984.   {***************************************************************************}
  985.   {* Wait for a max.5 minuttes for the outputbuffer to get empty.            *}
  986.   {***************************************************************************}
  987.  
  988. {#############################################################################}
  989. {#                                                                           #}
  990. {#             T e x t   F i l e   D e v i c e   D r i v e r .               #}
  991. {#                                                                           #}
  992. {#############################################################################}
  993.  
  994. PROCEDURE PurgeInFossil(VAR F:Text);
  995.   {***************************************************************************}
  996.   {* Purge the contents of the inputbuffer for the current port              *}
  997.   {***************************************************************************}
  998.  
  999. PROCEDURE PurgeOutFossil(VAR F:Text);
  1000.   {***************************************************************************}
  1001.   {* Purge the contents of the outputbuffer for the current port             *}
  1002.   {***************************************************************************}
  1003.  
  1004. FUNCTION FossilCarrier(VAR F:Text):Boolean;
  1005.   {***************************************************************************}
  1006.   {* True if there is carrier on the current port.                           *}
  1007.   {***************************************************************************}
  1008.  
  1009. FUNCTION FossilPressed(VAR F:Text):Boolean;
  1010.   {***************************************************************************}
  1011.   {* True if there is a character ready in the input buffer for this port.   *}
  1012.   {***************************************************************************}
  1013.  
  1014. FUNCTION ReadFossil(VAR F:Text):Char;
  1015.   {***************************************************************************}
  1016.   {* Read single charecter from an Fossil Text file driver                   *}
  1017.   {***************************************************************************}
  1018.  
  1019. PROCEDURE AssignFossil(VAR F: text; Port,Baud: Word);
  1020.   {***************************************************************************}
  1021.   {* Assign A Text File Device Driver                                        *}
  1022.   {***************************************************************************}
  1023.  
  1024. PROCEDURE SetSnoopFossil(VAR F: text; _Snoop: Boolean);
  1025.   {***************************************************************************}
  1026.   {* Enable/Disable Snoop mode for this device.                              *}
  1027.   {***************************************************************************}
  1028.  
  1029. PROCEDURE SetKeyboardFossil(VAR F: text; _Keyboard: Boolean);
  1030.   {***************************************************************************}
  1031.   {* Enable/Disable Keyboardmode for this Device.                            *}
  1032.   {***************************************************************************}
  1033.  
  1034. PROCEDURE SetExitFossil(VAR F: text; _Exit: Byte);
  1035.   {***************************************************************************}
  1036.   {* Set errorlevel to exit with if change inncarrier (if '0' don't exit)    *}
  1037.   {***************************************************************************}
  1038.  
  1039. PROCEDURE UseInOut(Port,Baud:Word);
  1040.   {**************************************************************************}
  1041.   {* Redirect standart input and output to Comport and maybe screen         *}
  1042.   {**************************************************************************}
  1043.  
  1044. PROCEDURE UnUseInOut;
  1045.   {**************************************************************************}
  1046.   {* Normalise input and output text files to the original.                 *}
  1047.   {**************************************************************************}
  1048.  
  1049.